package com.haoxi.gateway.cmpp30msg;


/**
 * Title:CMPP3.0,2004.09
 * ����״̬����
 */
public class CMPPStatusRpt {
    private String Msg_Id;
    private String Stat;
    private String Submit_time;
    private String Done_time;
    private String Dest_terminal_Id;
    private int SMSC_sequence;
    private byte[] bodybytes;
    public static final String DELIVERED = "DELIVRD";//����Ϣ���·����ֻ�
    public static final String EXPIRED = "EXPIRED";//����Ϣ��ʧЧ
    public static final String DELETED = "DELETED";//����Ϣ��ɾ��
    public static final String UNDELIVERABLE = "UNDELIV";//����Ϣ��û���·�
    public static final String ACCEPTED = "ACCEPTD";//����Ϣ�ѽ���
    public static final String UNKNOWN = "UNKNOWN";//����Ϣ����һ����Ч��״̬
    public static final String REJECTED = "REJECTD";//����Ϣ�Ǿܾ�״̬

    public CMPPStatusRpt ( byte inputbytes[] ) {
        this.bodybytes = inputbytes;
        parseBody ();
    }

    private void parseBody () {
        byte[] temp = new byte[8];
        CMPPCommon.BytesCopy ( bodybytes, temp, 0, 7, 0 );
        Msg_Id = "";
        for ( int i = 0; i < temp.length; i++ ) {
            Msg_Id += temp[ i ];
        }
        Stat = new String ( bodybytes, 8, 7 );
        Submit_time = new String ( bodybytes, 15, 10 );
        Done_time = new String ( bodybytes, 25, 10 );
        Dest_terminal_Id = new String ( bodybytes, 35, 21 );
        byte[] tempbytes = new byte[4];
        CMPPCommon.BytesCopy ( bodybytes, tempbytes, 56, 59, 0 );
        SMSC_sequence = CMPPCommon.Bytes4ToInt ( tempbytes );
    }
    public byte[] getMsgIdbytes()
    {
        byte[] result=new byte[8];
        System.arraycopy(bodybytes,0,result,0,8);
        return result;
    }
    public String getMsg_Id () {
        return Msg_Id;
    }

    public String getStat () {
        return Stat;
    }

    public String getSubmit_time () {
        return Submit_time;
    }

    public String getDone_time () {
        return Done_time;
    }

    public String getDest_terminal_Id () {
        return Dest_terminal_Id;
    }

    public int getSMSC_sequence () {
        return SMSC_sequence;
    }
}